package com.ymatou.iapi.godmch.service;

import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.database.model.godmch.mch_depot_info;
import com.ymttest.utils.EnvSetup;
/**
*批量查询仓库信息Call
*FreeMaker Template自动生成代码
*/
public class getDepotByIdListCall extends YmatouBaseCall{
	private static String opurl ="/api/depot/getDepotByIdList";
	
	public getDepotByIdListCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	 public String getStatusCode1()
		{
		  return getString("status");
		}
	 
	public List<mch_depot_info> getDepots() {
		List<mch_depot_info> result =null;
		try {
			result = (List<mch_depot_info>) new Gson().fromJson(getJsonObject().get("result").getAsJsonObject().get("depotList").getAsJsonArray().toString(), new TypeToken<List<mch_depot_info>>() {}.getType());
		} catch (Exception e) {
//			e.printStackTrace();
		}
		return result;
	}
}